This is standalone code that you should run before you check in changes to psrcplot.
# This allows PSRC fonts to be used in the R session
install_psrc_fonts()
mode_shares <- read.csv(file='example_data.csv') %>%
filter(Category=="Mode to Work by Race") %>%
filter(Geography=="Region" & Race=="Total") %>%
mutate(Year = as.character(Year))
# Column Charts -----------------------------------------------------
modes_column_chart <- static_column_chart(t=mode_shares, x="Mode",y="share", fill="Year",
est = "percent",
title="Mode Share to Work",
alt="Chart of Work Mode Shares",
source=paste("Source: U.S. Census Bureau, ACS 5-Year Estimates, table B3002",
"for King, Kitsap, Pierce and Snohomish counties.",
sep = "\n"),
color="pgnobgy_5",
dec = 0,
xlabel = "Mode to Work")
modes_column_chart
interactive_modes_column_chart <- interactive_column_chart(t=mode_shares, x="Mode",y="share", fill="Year",
est = "percent",
title="Mode Share to Work",
subtitle="For People 16+ with a job",
alt="Chart of Work Mode Shares",
source=paste("Source: U.S. Census Bureau, ACS 5-Year Estimates, table B3002"),
color="pgnobgy_5",
dec = 0)
interactive_modes_column_chart
modes_bar_chart <- static_bar_chart(t=mode_shares, x="share", y="Mode", fill="Year",
est = "percent",
title="Mode Share to Work",
alt="Chart of Work Mode Shares",
source=paste("Source: U.S. Census Bureau, ACS 5-Year Estimates, table B3002",
"for King, Kitsap, Pierce and Snohomish counties.",
sep = "\n"),
color="gnbopgy_5",
dec = 0)
modes_bar_chart
modes_bar_chart_moe <- static_bar_chart(t=mode_shares, x="share", y="Mode", fill="Year",
alt="Chart of Work Mode Shares",
source=paste("Source: U.S. Census Bureau, ACS 5-Year Estimates, table B3002",
"for King, Kitsap, Pierce and Snohomish counties.",
sep = "\n"),
color="obgnpgy_5",
moe = "share_moe",
xlabel = "Share of Workers",
ylabel = "Mode to Work")
modes_bar_chart_moe
interactive_modes_bar_chart <- interactive_bar_chart(t=mode_shares,
x="share", y="Mode", fill="Year",
est = "percent",
title="Mode Share to Work",
color="gnbopgy_5",
dec = 0)
interactive_modes_bar_chart
interactive_mode_line_chart <- interactive_line_chart(t=mode_shares %>% mutate(Year=as.integer(Year)),
x="Year", y="share", fill="Mode",
est = "percent",
title="Mode Share to Work",
color="gnbopgy_5",
dec = 0)
interactive_mode_line_chart